package com.yun.many.auth.dao.enums;

import com.yun.many.dao.enums.IDbEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum UserStatusEnum implements IDbEnum<Integer> {
    NORMAL(0, "正常"),
    FROZEN(1, "锁定"),
    UN_VALID(2, "未验证");

    private final Integer value;
    private final String desc;

    public static UserStatusEnum of(Integer value) {
        for (UserStatusEnum status : values()) {
            if (status.value.equals(value)) {
                return status;
            }
        }
        return null;
    }
}
